;;; const.el -*- lexical-binding: t; -*-

(defconst canary-emacs-min-version "25.1"
  "Minimal version of Emacs.")

(defconst canary-site-lisp-dir
  (expand-file-name "site-lisp" user-emacs-directory)
  "Root directory for Emacs packages.

Don't need to download from ELPA, I use git submodule to manage the version
of those packages.")

(defconst canary-lisp-dir
  (expand-file-name "lisp" user-emacs-directory)
  "Root directory for personal config.")

(defconst canary-local-dir
  (expand-file-name ".local" user-emacs-directory)
  "Root directory for local Emacs files. Use this as permanent storage for files
that are safe to share across systems (if this config is symlinked across
several computers).")

(defconst canary-themes-dir
  (expand-file-name "themes" canary-site-lisp-dir)
  "Root directory for color theme packages.")

(defconst canary-etc-dir
  (expand-file-name "etc" canary-local-dir)
  "Directory for non-volatile storage.

Use this for files that don't change much, like servers binaries, external
dependencies or long-term shared data.")

(defconst canary-cache-dir
  (expand-file-name "cache" canary-local-dir)
  "Directory for volatile storage.

Use this for files that change often, like cache files.")

(defconst *sys-is-linux*
  (eq system-type 'gnu/linux)
  "Running on Linux.")

(defconst *sys-is-linux-x*
  (and (display-graphic-p) *sys-is-linux*)
  "Running under X on Linux.")

(defconst *sys-is-mac*
  (eq system-type 'darwin)
  "Running on macOS")

(defconst *sys-is-mac-x*
  (and (display-graphic-p) *sys-is-mac*)
  "Running under X on macOS.")

(defconst *sys-is-windows*
  (memq system-type '(windows-nt ms-dos))
  "Running on Windows")

(defconst *sys-is-cygwin*
  (eq system-type 'cygwin)
  "Running on Cygwin")

(defconst *version-25+*
  (>= emacs-major-version 25)
  "Emacs version is 25 or above.")

(defconst *version-26+*
  (>= emacs-major-version 26)
  "Emacs version is 26 or above.")

(defconst *version-27+*
  (>= emacs-major-version 27)
  "Emacs version is 27 or above.")
